const CryptoJS = require("crypto-js");
const secretKey = 'cpdd1122'

const aesEncrypt = function(message) {
    const encrypted = CryptoJS.AES.encrypt(message, secretKey).toString();
    return encrypted
}

const aesDecrypt = function(encrypted) {
    const decrypted = CryptoJS.AES.decrypt(encrypted, secretKey).toString(CryptoJS.enc.Utf8);
    return decrypted
}

exports.aesEncrypt = aesEncrypt
exports.aesDecrypt = aesDecrypt
